<%@page import="com.core.utils.LocalizableString"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>


<%@page import="com.entities.projecttask.list.TaskTaskListController"%>
<%@page import="com.entities.projecttask.list.ProjectTasksListController"%>
<%@page import="com.core.utils.GlobalConstants"%>
<%@page import="com.entities.projecttask.actionscript.ActionScriptParserTaskDescription"%>
<%@page import="com.core.utils.RecordState"%>
<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@page import="com.entities.projecttask.detail.TaskDetailController"%>



<%@page import="java.util.List"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<link type="text/css" rel="stylesheet" href="css/header.css">
<link type="text/css" rel="stylesheet" href="css/menu.css">
<link type="text/css" rel="stylesheet" href="css/maincontainer.css">
<link type="text/css" rel="stylesheet" href="css/navigator.css">
<link type="text/css" rel="stylesheet" href="css/tableview.css">
<link type="text/css" rel="stylesheet" href="css/detailsview.css">
<link type="text/css" rel="stylesheet" href="css/actionbar.css">
<script type="text/javascript" src="js/jQuery/1.6.4/jquery.min.js"></script>

</head>

<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>

<body>

    <jsp:useBean id="menuController" class="com.core.ui.controller.MenuController" scope="session" />

    <jsp:useBean id="tabSheetController" class="com.core.ui.controller.TabSheetController" scope="page" />

    <jsp:useBean id="stackNavigatorController" class="com.core.ui.controller.StackNavigatorController" scope="session" />


    <%
    	String taskId = request.getParameter("id");

            SessionManager.setContext(GlobalConstants.USERCONTEXT_TASK);
            SessionManager.addContext(GlobalConstants.USERCONTEXT_SUBTASKADD);

            ActionScriptParserTaskDescription taskDescriptionActionScriptParser = new ActionScriptParserTaskDescription();
            taskDescriptionActionScriptParser.setTaskId(taskId);

            ActionBarController actionBarController = new ActionBarController();
            actionBarController.setActionScriptParser(taskDescriptionActionScriptParser);

            LocalizableString localizableString = LocalizableString.sharedInstance();
            String details = localizableString.localizable("view.description.field.details");
            String people = localizableString.localizable("view.description.field.people");
            String dates = localizableString.localizable("view.description.field.dates");            
            String attributes = localizableString.localizable("view.description.field.attributes");
            
            TaskDetailController taskItemController = new TaskDetailController();
            taskItemController.setEditMode(RecordState.Mode.ADD);
            taskItemController.reloadData();
    %>


    <sorokina:PageTitleView />

    <sorokina:PageMenuView datasource="<%=menuController %>" />

    <sorokina:PageHeader pageCaption="New subtask" pageAvatar="img/entities/Task.png"/>

    <form action="<%=GlobalConstants.SERVLET_SUBTASKADD%>" method="POST" name="EditForm">

        <div class="maincontainer">
            <div class="datacontainer" id="datacountainer">
                <div class="content">
                    <div class="module">
                        <sorokina:ActionBarView datasource="<%=actionBarController %>" />
                    </div>
                </div>
                <%--
                
                
                    attributes
                                    
                 --%>
                <div class="primary_container_75">
                    <div class="content">

                        <div class="module">
                            <div class="mod-header">
                                <h3 class="toggle-title"><%=details %></h3>
                            </div>
                            <sorokina:DetailTableView delegate="<%= taskItemController%>" userInfo="BASE" tableClass="properties-list-two-columns" />
                        </div>

                        <div class="module">
                            <div class="mod-header">
                                <h3 class="toggle-title"><%=attributes %></h3>
                            </div>
                            <sorokina:DetailTableView delegate="<%= taskItemController%>" userInfo="ATTRIBUTES"
                                tableClass="properties-list-two-columns" />
                        </div>


                    </div>
                </div>
                <%--
                
                
                    users
                                    
                 --%>
                <div class="secondary_container">

                    <div class="content">
                        <div class="module">
                            <div class="mod-header">
                                <h3 class="toggle-title"><%=people %></h3>
                            </div>
                            <sorokina:DetailTableView delegate="<%= taskItemController%>" userInfo="PEOPLE" tableClass="properties-list-two-columns" />
                        </div>


                    </div>
                    <%--

Dates
 --%>
                    <div class="content">
                        <div class="module">
                            <div class="mod-header">
                                <h3 class="toggle-title"><%=dates %></h3>
                            </div>
                            <sorokina:DetailTableView delegate="<%= taskItemController%>" userInfo="DATES" tableClass="properties-list-two-columns" />
                        </div>

                    </div>


                </div>
            </div>
        </div>
    </form>

</body>
</html>